// import { Carousel } from "antd"
import { Iroutes } from './useRoutesWithGuard'
import { lazy } from 'react'
import Refund from "@/pages/transaction/refund"
import { createFromIconfontCN } from '@ant-design/icons'
let Home = lazy(()=>import('@/pages/home'))
let Commodity = lazy(()=>import('@/pages/commodity'))
let ShopClass = lazy(()=>import('@/pages/commodity/shopClass'))
let ShopList = lazy(()=>import('@/pages/commodity/shopList'))
let Login = lazy(()=>import('@/pages/login'))
let Order = lazy(() => import('@/pages/transaction/order'))
let Pay = lazy(() => import('@/pages/pay'))
let PayType = lazy(() => import('@/pages/pay/payType'))
let Picture = lazy(() => import('@/pages/picture'))
let Transaction = lazy(() => import('@/pages/transaction'))
let Money = lazy(() => import('@/pages/transaction/money'))
let CarouselCom=lazy(()=>import('@/pages/picture/carousel'))
const MyIcon = createFromIconfontCN({
    scriptUrl: '//at.alicdn.com/t/c/font_3853952_76rwnrbsaqh.js', // 在 iconfont.cn 上生成
});
let routes: Iroutes = [
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/',
        element: <Home />,
        children: [
            {
                path: 'commodity',
                element: <Commodity />,
                label: '商城管理',
                icon:<MyIcon type="icon-shangchengguanli" />,
                key:'commodity',
                children: [
                    {
                        path: 'shopClass',
                        label: '商品类目',
                        icon:<MyIcon type='icon-xiangsishangpin'/>,
                        key:'shopClass',
                        element: <ShopClass />,
                    },
                    {
                        path: 'shopList',
                        label: '商品管理',
                        key:'shopList',
                        icon:<MyIcon type='icon-shangpinguanli'/>,
                        element: <ShopList />,
                    }
                ]
            },
            {
                path: 'pay',
                element: <Pay />,
                label: '支付管理',
                icon:<MyIcon type='icon-zhifuguanli'/>,
                key:'pay',
                children: [
                    {
                        path: 'payType',
                        label: '支付类型',
                        icon:<MyIcon type='icon-zhifupingtai-paypal'/>,
                        key:'payType',
                        element: <PayType />
                    }
                ]
            },
            {
                path: 'picture',
                element: <Picture />,
                icon:<MyIcon type='icon-tupianguanli'/>,
                label: '图片管理',
                key:'picture',
                children: [
                    {
                        path: 'carousel',
                        label: '轮播图管理',
                        icon:<MyIcon type='icon-shouyelunbotu'/>,
                        element: <CarouselCom />,
                        key:'carousel',
                    }
                ]
            },
            {
                path: 'transaction',
                element: <Transaction />,
                icon:<MyIcon type='icon-jiaoyiguanli'/>,
                label: '交易管理',
                key:'transaction',
                children: [
                    {
                        path: 'money',
                        label: '交易金额',
                        icon:<MyIcon type='icon-jine'/>,
                        key:'money',
                        element: <Money />,
                    },
                    {
                        path: 'order',
                        label: '订单管理',
                        icon:<MyIcon type='icon-dingdanguanli'/>,
                        key:'order',
                        element: <Order />,
                    },
                    {
                        path: 'refund',
                        label: '退款管理',
                        icon:<MyIcon type='icon-tuikuanguanli'/>,
                        key:'refund',
                        element: <Refund />,
                    },
                ]
            }
        ]
    }

]

export default routes